<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simplejson.scanner</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simplejson-module.html">Package&nbsp;simplejson</a> ::
        Module&nbsp;scanner
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="simplejson.scanner-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="simplejson.scanner-module.html" onclick="show_private();">Module simplejson.scanner</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-docstring">Iterator based sre token scanner</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">re</tt> <tt class="py-keyword">import</tt> <tt class="py-name">VERBOSE</tt><tt class="py-op">,</tt> <tt class="py-name">MULTILINE</tt><tt class="py-op">,</tt> <tt class="py-name">DOTALL</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sre_parse</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sre_compile</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sre_constants</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">sre_constants</tt> <tt class="py-keyword">import</tt> <tt class="py-name">BRANCH</tt><tt class="py-op">,</tt> <tt class="py-name">SUBPATTERN</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable simplejson.decoder.JSONDecoder.__all__=simplejson.decoder.JSONDecoder-class.html#__all__,Variable simplejson.encoder.JSONEncoder.__all__=simplejson.encoder.JSONEncoder-class.html#__all__"><a title="simplejson.decoder.JSONDecoder.__all__
simplejson.encoder.JSONEncoder.__all__" class="py-name" href="#" onclick="return doclink('link-0', '__all__', 'link-0');">__all__</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">'Scanner'</tt><tt class="py-op">,</tt> <tt class="py-string">'pattern'</tt><tt class="py-op">]</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt id="link-1" class="py-name" targets="Variable simplejson.decoder.FLAGS=simplejson.decoder-module.html#FLAGS,Variable simplejson.scanner.FLAGS=simplejson.scanner-module.html#FLAGS"><a title="simplejson.decoder.FLAGS
simplejson.scanner.FLAGS" class="py-name" href="#" onclick="return doclink('link-1', 'FLAGS', 'link-1');">FLAGS</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">VERBOSE</tt> <tt class="py-op">|</tt> <tt class="py-name">MULTILINE</tt> <tt class="py-op">|</tt> <tt class="py-name">DOTALL</tt><tt class="py-op">)</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"> </tt>
<a name="Scanner"></a><div id="Scanner-def"><a name="L15"></a><tt class="py-lineno">15</tt> <a class="py-toggle" href="#" id="Scanner-toggle" onclick="return toggle('Scanner');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="simplejson.scanner.Scanner-class.html">Scanner</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Scanner-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="Scanner-expanded"><a name="Scanner.__init__"></a><div id="Scanner.__init__-def"><a name="L16"></a><tt class="py-lineno">16</tt> <a class="py-toggle" href="#" id="Scanner.__init__-toggle" onclick="return toggle('Scanner.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="simplejson.scanner.Scanner-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">lexicon</tt><tt class="py-op">,</tt> <tt class="py-param">flags</tt><tt class="py-op">=</tt><tt id="link-2" class="py-name"><a title="simplejson.decoder.FLAGS
simplejson.scanner.FLAGS" class="py-name" href="#" onclick="return doclink('link-2', 'FLAGS', 'link-1');">FLAGS</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Scanner.__init__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Scanner.__init__-expanded"><a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">actions</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">None</tt><tt class="py-op">]</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line">        <tt class="py-comment"># Combine phrases into a compound pattern</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-name">sre_parse</tt><tt class="py-op">.</tt><tt class="py-name">Pattern</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">        <tt class="py-name">s</tt><tt class="py-op">.</tt><tt class="py-name">flags</tt> <tt class="py-op">=</tt> <tt class="py-name">flags</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line">        <tt class="py-name">p</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">idx</tt><tt class="py-op">,</tt> <tt class="py-name">token</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">lexicon</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">            <tt class="py-name">phrase</tt> <tt class="py-op">=</tt> <tt class="py-name">token</tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Function simplejson.scanner.pattern()=simplejson.scanner-module.html#pattern"><a title="simplejson.scanner.pattern" class="py-name" href="#" onclick="return doclink('link-3', 'pattern', 'link-3');">pattern</a></tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line">                <tt class="py-name">subpattern</tt> <tt class="py-op">=</tt> <tt class="py-name">sre_parse</tt><tt class="py-op">.</tt><tt class="py-name">SubPattern</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">,</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">SUBPATTERN</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">idx</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">sre_parse</tt><tt class="py-op">.</tt><tt class="py-name">parse</tt><tt class="py-op">(</tt><tt class="py-name">phrase</tt><tt class="py-op">,</tt> <tt class="py-name">flags</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">sre_constants</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Function wsgi_http.error()=wsgi_http-module.html#error"><a title="wsgi_http.error" class="py-name" href="#" onclick="return doclink('link-4', 'error', 'link-4');">error</a></tt><tt class="py-op">:</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">            <tt class="py-name">p</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">subpattern</tt><tt class="py-op">)</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">actions</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">token</tt><tt class="py-op">)</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line">        <tt class="py-name">s</tt><tt class="py-op">.</tt><tt class="py-name">groups</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> <tt class="py-comment"># NOTE(guido): Added to make SRE validation work</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-name">p</tt> <tt class="py-op">=</tt> <tt class="py-name">sre_parse</tt><tt class="py-op">.</tt><tt class="py-name">SubPattern</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">BRANCH</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">p</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Module simplejson.scanner=simplejson.scanner-module.html"><a title="simplejson.scanner" class="py-name" href="#" onclick="return doclink('link-5', 'scanner', 'link-5');">scanner</a></tt> <tt class="py-op">=</tt> <tt class="py-name">sre_compile</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">)</tt> </tt>
</div><a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line"> </tt>
<a name="Scanner.iterscan"></a><div id="Scanner.iterscan-def"><a name="L36"></a><tt class="py-lineno">36</tt> <a class="py-toggle" href="#" id="Scanner.iterscan-toggle" onclick="return toggle('Scanner.iterscan');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="simplejson.scanner.Scanner-class.html#iterscan">iterscan</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">string</tt><tt class="py-op">,</tt> <tt class="py-param">idx</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">context</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Scanner.iterscan-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Scanner.iterscan-expanded"><a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"><tt class="py-docstring">        Yield match, end_idx for each match</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">        <tt class="py-name">match</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name"><a title="simplejson.scanner" class="py-name" href="#" onclick="return doclink('link-6', 'scanner', 'link-5');">scanner</a></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name"><a title="simplejson.scanner" class="py-name" href="#" onclick="return doclink('link-7', 'scanner', 'link-5');">scanner</a></tt><tt class="py-op">(</tt><tt class="py-name">string</tt><tt class="py-op">,</tt> <tt class="py-name">idx</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">match</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">        <tt class="py-name">actions</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">actions</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">        <tt class="py-name">lastend</tt> <tt class="py-op">=</tt> <tt class="py-name">idx</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">        <tt class="py-name">end</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">string</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">            <tt class="py-name">m</tt> <tt class="py-op">=</tt> <tt class="py-name">match</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">m</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">            <tt class="py-name">matchbegin</tt><tt class="py-op">,</tt> <tt class="py-name">matchend</tt> <tt class="py-op">=</tt> <tt class="py-name">m</tt><tt class="py-op">.</tt><tt class="py-name">span</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">lastend</tt> <tt class="py-op">==</tt> <tt class="py-name">matchend</tt><tt class="py-op">:</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">            <tt class="py-name">action</tt> <tt class="py-op">=</tt> <tt class="py-name">actions</tt><tt class="py-op">[</tt><tt class="py-name">m</tt><tt class="py-op">.</tt><tt class="py-name">lastindex</tt><tt class="py-op">]</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">action</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">                <tt class="py-name">rval</tt><tt class="py-op">,</tt> <tt class="py-name">next_pos</tt> <tt class="py-op">=</tt> <tt class="py-name">action</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">,</tt> <tt class="py-name">context</tt><tt class="py-op">)</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">next_pos</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">next_pos</tt> <tt class="py-op">!=</tt> <tt class="py-name">matchend</tt><tt class="py-op">:</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">                    <tt class="py-comment"># "fast forward" the scanner</tt> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-name">matchend</tt> <tt class="py-op">=</tt> <tt class="py-name">next_pos</tt> </tt>
<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">                    <tt class="py-name">match</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="simplejson.scanner" class="py-name" href="#" onclick="return doclink('link-8', 'scanner', 'link-5');">scanner</a></tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="simplejson.scanner" class="py-name" href="#" onclick="return doclink('link-9', 'scanner', 'link-5');">scanner</a></tt><tt class="py-op">(</tt><tt class="py-name">string</tt><tt class="py-op">,</tt> <tt class="py-name">matchend</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">match</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">                <tt class="py-keyword">yield</tt> <tt class="py-name">rval</tt><tt class="py-op">,</tt> <tt class="py-name">matchend</tt> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">            <tt class="py-name">lastend</tt> <tt class="py-op">=</tt> <tt class="py-name">matchend</tt> </tt>
</div></div><a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line"> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line"> </tt>
<a name="pattern"></a><div id="pattern-def"><a name="L62"></a><tt class="py-lineno">62</tt> <a class="py-toggle" href="#" id="pattern-toggle" onclick="return toggle('pattern');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simplejson.scanner-module.html#pattern">pattern</a><tt class="py-op">(</tt><tt class="py-param">pattern</tt><tt class="py-op">,</tt> <tt class="py-param">flags</tt><tt class="py-op">=</tt><tt id="link-10" class="py-name"><a title="simplejson.decoder.FLAGS
simplejson.scanner.FLAGS" class="py-name" href="#" onclick="return doclink('link-10', 'FLAGS', 'link-1');">FLAGS</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="pattern-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="pattern-expanded"><a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">    <tt class="py-keyword">def</tt> <tt class="py-def-name">decorator</tt><tt class="py-op">(</tt><tt class="py-param">fn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line">        <tt class="py-name">fn</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="simplejson.scanner.pattern" class="py-name" href="#" onclick="return doclink('link-11', 'pattern', 'link-3');">pattern</a></tt> <tt class="py-op">=</tt> <tt id="link-12" class="py-name"><a title="simplejson.scanner.pattern" class="py-name" href="#" onclick="return doclink('link-12', 'pattern', 'link-3');">pattern</a></tt> </tt>
<a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">        <tt class="py-name">fn</tt><tt class="py-op">.</tt><tt class="py-name">regex</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt id="link-13" class="py-name"><a title="simplejson.scanner.pattern" class="py-name" href="#" onclick="return doclink('link-13', 'pattern', 'link-3');">pattern</a></tt><tt class="py-op">,</tt> <tt class="py-name">flags</tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">fn</tt> </tt>
</div><a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">decorator</tt> </tt>
</div><a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Jan 29 04:00:46 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
